import random

action_index_to_action_name = ["STOP", "UP", "DOWN", "LEFT", "RIGHT"]


class ActionMessage:
    action_index: int

    def __init__(self, action_index: int):
        self.action_index = action_index

    def to_string(self):
        return action_index_to_action_name[self.action_index]

    def to_index(self):
        return self.action_index

    @staticmethod
    def random_action_index():
        return int(random.random() * len(action_index_to_action_name))
